3.13.30 \(\int (a+b x) (a c-b c x)^n \, dx\) [1230]

Optimal. Leaf size=53 \[ -\frac {2 a (a c-b c x)^{1+n}}{b c (1+n)}+\frac {(a c-b c x)^{2+n}}{b c^2 (2+n)} \]

[Out]

-2*a*(-b*c*x+a*c)^(1+n)/b/c/(1+n)+(-b*c*x+a*c)^(2+n)/b/c^2/(2+n)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.059, Rules used = {45} \begin {gather*} \frac {(a c-b c x)^{n+2}}{b c^2 (n+2)}-\frac {2 a (a c-b c x)^{n+1}}{b c (n+1)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*x)*(a*c - b*c*x)^n,x]

[Out]

(-2*a*(a*c - b*c*x)^(1 + n))/(b*c*(1 + n)) + (a*c - b*c*x)^(2 + n)/(b*c^2*(2 + n))

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

\begin {align*} \int (a+b x) (a c-b c x)^n \, dx &=\int \left (2 a (a c-b c x)^n-\frac {(a c-b c x)^{1+n}}{c}\right ) \, dx\\ &=-\frac {2 a (a c-b c x)^{1+n}}{b c (1+n)}+\frac {(a c-b c x)^{2+n}}{b c^2 (2+n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 43, normalized size = 0.81 \begin {gather*} \frac {(c (a-b x))^n (-a+b x) (a (3+n)+b (1+n) x)}{b (1+n) (2+n)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x)*(a*c - b*c*x)^n,x]

[Out]

((c*(a - b*x))^n*(-a + b*x)*(a*(3 + n) + b*(1 + n)*x))/(b*(1 + n)*(2 + n))

________________________________________________________________________________________

Mathics [C] Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.
time = 2.80, size = 256, normalized size = 4.83 \begin {gather*} \text {Piecewise}\left [\left \{\left \{a x \left (a c\right )^n,b\text {==}0\right \},\left \{\frac {a \left (2+\text {Log}\left [\frac {-a+b x}{b}\right ]\right )-b x \text {Log}\left [\frac {-a+b x}{b}\right ]}{b c^2 \left (a-b x\right )},n\text {==}-2\right \},\left \{\frac {-2 a \text {Log}\left [-\frac {a}{b}+x\right ]-b x}{b c},n\text {==}-1\right \}\right \},\frac {-3 a^2 \left (a c-b c x\right )^n}{2 b+3 b n+b n^2}-\frac {a^2 n \left (a c-b c x\right )^n}{2 b+3 b n+b n^2}+\frac {2 a b x \left (a c-b c x\right )^n}{2 b+3 b n+b n^2}+\frac {b^2 x^2 \left (a c-b c x\right )^n}{2 b+3 b n+b n^2}+\frac {b^2 n x^2 \left (a c-b c x\right )^n}{2 b+3 b n+b n^2}\right ] \end {gather*}

Warning: Unable to verify antiderivative.

[In]

mathics('Integrate[(a + b*x)^1*(a*c - b*c*x)^n,x]')

[Out]

Piecewise[{{a x (a c) ^ n, b == 0}, {(a (2 + Log[(-a + b x) / b]) - b x Log[(-a + b x) / b]) / (b c ^ 2 (a - b
 x)), n == -2}, {(-2 a Log[-a / b + x] - b x) / (b c), n == -1}}, -3 a ^ 2 (a c - b c x) ^ n / (2 b + 3 b n +
b n ^ 2) - a ^ 2 n (a c - b c x) ^ n / (2 b + 3 b n + b n ^ 2) + 2 a b x (a c - b c x) ^ n / (2 b + 3 b n + b
n ^ 2) + b ^ 2 x ^ 2 (a c - b c x) ^ n / (2 b + 3 b n + b n ^ 2) + b ^ 2 n x ^ 2 (a c - b c x) ^ n / (2 b + 3
b n + b n ^ 2)]

________________________________________________________________________________________

Maple [A]
time = 0.12, size = 47, normalized size = 0.89

method result size
gosper \(-\frac {\left (-b c x +a c \right )^{n} \left (b n x +a n +b x +3 a \right ) \left (-b x +a \right )}{b \left (n^{2}+3 n +2\right )}\) \(47\)
risch \(-\frac {\left (-b^{2} n \,x^{2}-x^{2} b^{2}+a^{2} n -2 a b x +3 a^{2}\right ) \left (c \left (-b x +a \right )\right )^{n}}{\left (2+n \right ) \left (1+n \right ) b}\) \(59\)
norman \(\frac {b \,x^{2} {\mathrm e}^{n \ln \left (-b c x +a c \right )}}{2+n}+\frac {2 a x \,{\mathrm e}^{n \ln \left (-b c x +a c \right )}}{n^{2}+3 n +2}-\frac {a^{2} \left (3+n \right ) {\mathrm e}^{n \ln \left (-b c x +a c \right )}}{b \left (n^{2}+3 n +2\right )}\) \(86\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)*(-b*c*x+a*c)^n,x,method=_RETURNVERBOSE)

[Out]

-(-b*c*x+a*c)^n*(b*n*x+a*n+b*x+3*a)*(-b*x+a)/b/(n^2+3*n+2)

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 81, normalized size = 1.53 \begin {gather*} \frac {{\left (b^{2} c^{n} {\left (n + 1\right )} x^{2} - a b c^{n} n x - a^{2} c^{n}\right )} {\left (-b x + a\right )}^{n}}{{\left (n^{2} + 3 \, n + 2\right )} b} - \frac {{\left (-b c x + a c\right )}^{n + 1} a}{b c {\left (n + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(-b*c*x+a*c)^n,x, algorithm="maxima")

[Out]

(b^2*c^n*(n + 1)*x^2 - a*b*c^n*n*x - a^2*c^n)*(-b*x + a)^n/((n^2 + 3*n + 2)*b) - (-b*c*x + a*c)^(n + 1)*a/(b*c
*(n + 1))

________________________________________________________________________________________

Fricas [A]
time = 0.31, size = 58, normalized size = 1.09 \begin {gather*} -\frac {{\left (a^{2} n - 2 \, a b x - {\left (b^{2} n + b^{2}\right )} x^{2} + 3 \, a^{2}\right )} {\left (-b c x + a c\right )}^{n}}{b n^{2} + 3 \, b n + 2 \, b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(-b*c*x+a*c)^n,x, algorithm="fricas")

[Out]

-(a^2*n - 2*a*b*x - (b^2*n + b^2)*x^2 + 3*a^2)*(-b*c*x + a*c)^n/(b*n^2 + 3*b*n + 2*b)

________________________________________________________________________________________

Sympy [A]
time = 0.28, size = 245, normalized size = 4.62 \begin {gather*} \begin {cases} a x \left (a c\right )^{n} & \text {for}\: b = 0 \\- \frac {a \log {\left (- \frac {a}{b} + x \right )}}{- a b c^{2} + b^{2} c^{2} x} - \frac {2 a}{- a b c^{2} + b^{2} c^{2} x} + \frac {b x \log {\left (- \frac {a}{b} + x \right )}}{- a b c^{2} + b^{2} c^{2} x} & \text {for}\: n = -2 \\- \frac {2 a \log {\left (- \frac {a}{b} + x \right )}}{b c} - \frac {x}{c} & \text {for}\: n = -1 \\- \frac {a^{2} n \left (a c - b c x\right )^{n}}{b n^{2} + 3 b n + 2 b} - \frac {3 a^{2} \left (a c - b c x\right )^{n}}{b n^{2} + 3 b n + 2 b} + \frac {2 a b x \left (a c - b c x\right )^{n}}{b n^{2} + 3 b n + 2 b} + \frac {b^{2} n x^{2} \left (a c - b c x\right )^{n}}{b n^{2} + 3 b n + 2 b} + \frac {b^{2} x^{2} \left (a c - b c x\right )^{n}}{b n^{2} + 3 b n + 2 b} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(-b*c*x+a*c)**n,x)

[Out]

Piecewise((a*x*(a*c)**n, Eq(b, 0)), (-a*log(-a/b + x)/(-a*b*c**2 + b**2*c**2*x) - 2*a/(-a*b*c**2 + b**2*c**2*x
) + b*x*log(-a/b + x)/(-a*b*c**2 + b**2*c**2*x), Eq(n, -2)), (-2*a*log(-a/b + x)/(b*c) - x/c, Eq(n, -1)), (-a*
*2*n*(a*c - b*c*x)**n/(b*n**2 + 3*b*n + 2*b) - 3*a**2*(a*c - b*c*x)**n/(b*n**2 + 3*b*n + 2*b) + 2*a*b*x*(a*c -
 b*c*x)**n/(b*n**2 + 3*b*n + 2*b) + b**2*n*x**2*(a*c - b*c*x)**n/(b*n**2 + 3*b*n + 2*b) + b**2*x**2*(a*c - b*c
*x)**n/(b*n**2 + 3*b*n + 2*b), True))

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 113, normalized size = 2.13 \begin {gather*} \frac {-a^{2} n \mathrm {e}^{n \ln \left (a c-b c x\right )}-3 a^{2} \mathrm {e}^{n \ln \left (a c-b c x\right )}+2 a b x \mathrm {e}^{n \ln \left (a c-b c x\right )}+b^{2} n x^{2} \mathrm {e}^{n \ln \left (a c-b c x\right )}+b^{2} x^{2} \mathrm {e}^{n \ln \left (a c-b c x\right )}}{b n^{2}+3 b n+2 b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(-b*c*x+a*c)^n,x)

[Out]

((-b*c*x + a*c)^n*b^2*n*x^2 + (-b*c*x + a*c)^n*b^2*x^2 - (-b*c*x + a*c)^n*a^2*n + 2*(-b*c*x + a*c)^n*a*b*x - 3
*(-b*c*x + a*c)^n*a^2)/(b*n^2 + 3*b*n + 2*b)

________________________________________________________________________________________

Mupad [B]
time = 0.32, size = 66, normalized size = 1.25 \begin {gather*} {\left (a\,c-b\,c\,x\right )}^n\,\left (\frac {2\,a\,x}{n^2+3\,n+2}-\frac {a^2\,\left (n+3\right )}{b\,\left (n^2+3\,n+2\right )}+\frac {b\,x^2\,\left (n+1\right )}{n^2+3\,n+2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*c - b*c*x)^n*(a + b*x),x)

[Out]

(a*c - b*c*x)^n*((2*a*x)/(3*n + n^2 + 2) - (a^2*(n + 3))/(b*(3*n + n^2 + 2)) + (b*x^2*(n + 1))/(3*n + n^2 + 2)
)

________________________________________________________________________________________